home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / terracre.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  18KB  |  548 lines

  1. /******************************************************************
  2. Terra Cresta (preliminary)
  3. Nichibutsu 1985
  4. 68000 + Z80
  5.  
  6. driver by Carlos A. Lozano
  7.  
  8. TODO: I'm playing samples with a DAC, but they could be ADPCM
  9.  
  10. Carlos A. Lozano (calb@gsyc.inf.uc3m.es)
  11.  
  12. MEMORY MAP
  13. 0x000000 - 0x01ffff   ROM
  14. 0x020000 - 0x02006f   VRAM (Sprites)???
  15. 0x020070 - 0x021fff   RAM
  16. 0x022000 - 0x022fff   VRAM (Background)???
  17. 0x024000 - 0x24000f   Input Ports
  18. 0x026000 - 0x26000f   Output Ports
  19. 0x028000 - 0x287fff   VRAM (Tiles)
  20.  
  21. VRAM(Background)
  22. 0x22000 - 32 bytes (16 tiles)
  23. 0x22040 - 32 bytes (16 tiles)
  24. 0x22080 - 32 bytes (16 tiles)
  25. 0x220c0 - 32 bytes (16 tiles)
  26. 0x22100 - 32 bytes (16 tiles)
  27. ...
  28. 0x22fc0 - 32 bytes (16 tiles)
  29.  
  30. VRAM(Tiles)
  31. 0x28000-0x287ff (1024 tiles 8x8 tiles, 2 bytes every tile)
  32.  
  33. VRAM(Sprites)
  34. 0x20000-0x201ff
  35.  
  36. ******************************************************************/
  37.  
  38. #include "driver.h"
  39. #include "vidhrdw/generic.h"
  40. #include "cpu/m68000/m68000.h"
  41.  
  42. unsigned char* terrac_ram;
  43.  
  44. void terrac_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  45. void terracre_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  46. //void terracre_vh_screenrefresh(struct osd_bitmap *bitmap);
  47. int terrac_vh_start(void);
  48. void terrac_vh_stop(void);
  49. WRITE_HANDLER( terrac_videoram2_w );
  50. READ_HANDLER( terrac_videoram2_r );
  51.  
  52. extern unsigned char *terrac_videoram;
  53. extern size_t terrac_videoram_size;
  54. extern unsigned char terrac_scrolly[];
  55.  
  56.  
  57. WRITE_HANDLER( terracre_misc_w )
  58. {
  59.     switch (offset)
  60.     {
  61. //        case 0: /* ??? */
  62. //            break;
  63.         case 2: /* Scroll Y */
  64.             COMBINE_WORD_MEM(terrac_scrolly,data);
  65.             return;
  66.             break;
  67. //        case 4: /* ??? */
  68. //            break;
  69. //        case 0xa: /* ??? */
  70. //            break;
  71.         case 0xc: /* sound command */
  72.             soundlatch_w(offset,((data & 0x7f) << 1) | 1);
  73.             return;
  74.             break;
  75. //        case 0xe: /* ??? */
  76. //            break;
  77.     }
  78.  
  79.     logerror("OUTPUT [%x] <- %08x\n", offset,data );
  80. }
  81.  
  82. static READ_HANDLER( terracre_ports_r )
  83. {
  84.     switch (offset)
  85.     {
  86.         case 0: /* Player controls */
  87.             return readinputport(0);
  88.  
  89.         case 2: /* Dipswitch 0xf000*/
  90.             return readinputport(1);
  91.  
  92.         case 4: /* Start buttons & Dipswitch */
  93.             return readinputport(2) << 8;
  94.  
  95.         case 6: /* Dipswitch???? */
  96.             return (readinputport(4) << 8) | readinputport(3);
  97.     }
  98.     return 0xffff;
  99. }
  100.  
  101.  
  102. static READ_HANDLER( soundlatch_clear_r )
  103. {
  104.     soundlatch_clear_w(0,0);
  105.     return 0;
  106. }
  107.  
  108.  
  109.  
  110. static struct MemoryReadAddress readmem[] =
  111. {
  112.     { 0x000000, 0x01ffff, MRA_ROM },
  113.     { 0x020000, 0x0201ff, MRA_BANK1 },
  114.     { 0x020200, 0x021fff, MRA_BANK2 },
  115.     { 0x022000, 0x022fff, terrac_videoram2_r },
  116.     { 0x023000, 0x023fff, MRA_BANK3 },
  117.     { 0x024000, 0x024007, terracre_ports_r },
  118.     { 0x028000, 0x0287ff, MRA_BANK4 },
  119.     { -1 }    /* end of table */
  120. };
  121.  
  122. static struct MemoryWriteAddress writemem[] =
  123. {
  124.     { 0x000000, 0x01ffff, MWA_ROM },
  125.     { 0x020000, 0x0201ff, MWA_BANK1, &spriteram, &spriteram_size },
  126.     { 0x020200, 0x021fff, MWA_BANK2, &terrac_ram },
  127.     { 0x022000, 0x022fff, terrac_videoram2_w, &terrac_videoram, &terrac_videoram_size },
  128.     { 0x023000, 0x023fff, MWA_BANK3 },
  129.     { 0x026000, 0x02600f, terracre_misc_w },
  130.     { 0x028000, 0x0287ff, MWA_BANK4, &videoram, &videoram_size },
  131.     { -1 }    /* end of table */
  132. };
  133.  
  134. static struct MemoryReadAddress sound_readmem[] =
  135. {
  136.     { 0x0000, 0xbfff, MRA_ROM },
  137.     { 0xc000, 0xcfff, MRA_RAM },
  138.     { -1 }    /* end of table */
  139. };
  140.  
  141. static struct MemoryWriteAddress sound_writemem[] =
  142. {
  143.     { 0x0000, 0xbfff, MWA_ROM },
  144.     { 0xc000, 0xcfff, MWA_RAM },
  145.     { -1 }    /* end of table */
  146. };
  147.  
  148.  
  149. static struct IOReadPort sound_readport[] =
  150. {
  151.     { 0x04, 0x04, soundlatch_clear_r },
  152.     { 0x06, 0x06, soundlatch_r },
  153.     { -1 }    /* end of table */
  154. };
  155.  
  156. static struct IOWritePort sound_writeport_3526[] =
  157. {
  158.     { 0x00, 0x00, YM3526_control_port_0_w },
  159.     { 0x01, 0x01, YM3526_write_port_0_w },
  160.     { 0x02, 0x02, DAC_0_signed_data_w },
  161.     { 0x03, 0x03, DAC_1_signed_data_w },
  162.     { -1 }    /* end of table */
  163. };
  164.  
  165. static struct IOWritePort sound_writeport_2203[] =
  166. {
  167.     { 0x00, 0x00, YM2203_control_port_0_w },
  168.     { 0x01, 0x01, YM2203_write_port_0_w },
  169.     { 0x02, 0x02, DAC_0_signed_data_w },
  170.     { 0x03, 0x03, DAC_1_signed_data_w },
  171.     { -1 }    /* end of table */
  172. };
  173.  
  174.  
  175. INPUT_PORTS_START( terracre )
  176.     PORT_START    /* Player 1 controls */
  177.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  178.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  179.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  180.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  181.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  182.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  183.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  184.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  185.  
  186.     PORT_START    /* Player 2 controls */
  187.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL  )
  188.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  189.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  190.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  191.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  192.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  193.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  194.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  195.  
  196.     PORT_START    /* Coin, Start, Test, Dipswitch */
  197.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  198.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  199.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 )
  200.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 )
  201.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 )
  202.     PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
  203.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  204.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  205.  
  206.     PORT_START    /* Dipswitch */
  207.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )
  208.     PORT_DIPSETTING(    0x03, "3" )
  209.     PORT_DIPSETTING(    0x02, "4" )
  210.     PORT_DIPSETTING(    0x01, "5" )
  211.     PORT_DIPSETTING(    0x00, "6" )
  212.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
  213.     PORT_DIPSETTING(    0x0c, "20000 60000" )
  214.     PORT_DIPSETTING(    0x08, "30000 70000" )
  215.     PORT_DIPSETTING(    0x04, "40000 80000" )
  216.     PORT_DIPSETTING(    0x00, "50000 90000" )
  217.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) )
  218.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  219.     PORT_DIPSETTING(    0x10, DEF_STR( On ) )
  220.     PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) )
  221.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  222.     PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
  223.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  224.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  225.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  226.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  227.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  228.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  229.  
  230.     PORT_START    /* Dipswitch */
  231.     PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
  232.     PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
  233.     PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
  234.     PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
  235.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  236.     PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_B ) )
  237.     PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
  238.     PORT_DIPSETTING(    0x04, DEF_STR( 2C_3C ) )
  239.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_3C ) )
  240.     PORT_DIPSETTING(    0x08, DEF_STR( 1C_6C ) )
  241.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Difficulty ) )
  242.     PORT_DIPSETTING(    0x10, "Easy" )
  243.     PORT_DIPSETTING(    0x00, "Hard" )
  244.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  245.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  246.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  247.     PORT_BITX(    0x40, 0x40, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  248.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  249.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  250.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  251.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  252.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  253. INPUT_PORTS_END
  254.  
  255.  
  256.  
  257. static struct GfxLayout charlayout =
  258. {
  259.     8,8,    /* 8*8 characters */
  260.     256,    /* 256 characters */
  261.     4,    /* 4 bits per pixel */
  262.     { 0, 1, 2, 3 },
  263.     { 4, 0, 12, 8, 20, 16, 28, 24},
  264.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
  265.     32*8    /* every char takes 32 consecutive bytes */
  266. };
  267.  
  268. static struct GfxLayout backlayout =
  269. {
  270.     16,16,    /* 16*16 chars */
  271.     512,    /* 512 characters */
  272.     4,        /* 4 bits per pixel */
  273.     { 0, 1, 2, 3 }, /* plane offset */
  274.     { 4, 0, 12, 8, 20, 16, 28, 24,
  275.         32+4, 32+0, 32+12, 32+8, 32+20, 32+16, 32+28, 32+24, },
  276.     { 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,
  277.         8*64, 9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64 },
  278.     128*8   /* every char takes 128 consecutive bytes  */
  279. };
  280.  
  281. static struct GfxLayout spritelayout =
  282. {
  283.     16,16,    /* 16*16 characters */
  284.     512,    /* 512 sprites */
  285.     4,    /* 4 bits per pixel */
  286.     { 0, 1, 2, 3 },
  287.     { 4, 0, 4+0x8000*8, 0+0x8000*8, 12, 8, 12+0x8000*8, 8+0x8000*8,
  288.         20, 16, 20+0x8000*8, 16+0x8000*8, 28, 24, 28+0x8000*8, 24+0x8000*8 },
  289.     { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
  290.           8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
  291.     64*8    /* every char takes 64 consecutive bytes  */
  292. };
  293.  
  294.  
  295. static struct GfxDecodeInfo gfxdecodeinfo[] =
  296. {
  297.     { REGION_GFX1, 0, &charlayout,            0,   1 },
  298.     { REGION_GFX2, 0, &backlayout,         1*16,  16 },
  299.     { REGION_GFX3, 0, &spritelayout, 1*16+16*16, 256 },
  300.     { -1 } /* end of array */
  301. };
  302.  
  303.  
  304.  
  305.  
  306. static struct YM3526interface ym3526_interface =
  307. {
  308.     1,            /* 1 chip (no more supported) */
  309.     4000000,    /* 4 MHz ? (hand tuned) */
  310.     { 255 }        /* (not supported) */
  311. };
  312.  
  313. static struct YM2203interface ym2203_interface =
  314. {
  315.     1,            /* 1 chip */
  316.     3000000,    /* 3 MHz ???? */
  317.     { YM2203_VOL(40,20), YM2203_VOL(40,20) },
  318.     { 0 },
  319.     { 0 },
  320.     { 0 },
  321.     { 0 }
  322. };
  323.  
  324. static struct DACinterface dac_interface =
  325. {
  326.     2,    /* 2 channels */
  327.     { 50, 50 }
  328. };
  329.  
  330.  
  331. static struct MachineDriver machine_driver_ym3526 =
  332. {
  333.     {
  334.         {
  335.             CPU_M68000,
  336.             8000000, /* 8 Mhz?? */
  337.             readmem,writemem,0,0,
  338.             m68_level1_irq,1
  339.         },
  340.         {
  341.             CPU_Z80 | CPU_AUDIO_CPU,
  342.             4000000,    /* 4 MHz???? */
  343.             sound_readmem,sound_writemem,sound_readport,sound_writeport_3526,
  344.             interrupt,128    /* ??? */
  345.         },
  346.     },
  347.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  348.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  349.     0,
  350.  
  351.     /* video hardware */
  352.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  353.     gfxdecodeinfo,
  354.     256, 1*16+16*16+16*256,
  355.     terrac_vh_convert_color_prom,
  356.  
  357.     VIDEO_TYPE_RASTER,
  358.     0,
  359.     terrac_vh_start,
  360.     terrac_vh_stop,
  361.     terracre_vh_screenrefresh,
  362.  
  363.     /* sound hardware */
  364.     0,0,0,0,
  365.     {
  366.         {
  367.            SOUND_YM3526,
  368.            &ym3526_interface
  369.         },
  370.         {
  371.             SOUND_DAC,
  372.             &dac_interface
  373.         }
  374.     }
  375. };
  376.  
  377. static struct MachineDriver machine_driver_ym2203 =
  378. {
  379.     {
  380.         {
  381.             CPU_M68000,
  382.             8000000, /* 8 Mhz?? */
  383.             readmem,writemem,0,0,
  384.             m68_level1_irq,1
  385.         },
  386.         {
  387.             CPU_Z80 | CPU_AUDIO_CPU,
  388.             4000000,    /* 4 MHz???? */
  389.             sound_readmem,sound_writemem,sound_readport,sound_writeport_2203,
  390.             interrupt,128    /* ??? */
  391.         },
  392.     },
  393.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  394.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  395.     0,
  396.  
  397.     /* video hardware */
  398.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  399.     gfxdecodeinfo,
  400.     256, 1*16+16*16+16*256,
  401.     terrac_vh_convert_color_prom,
  402.  
  403.     VIDEO_TYPE_RASTER,
  404.     0,
  405.     terrac_vh_start,
  406.     terrac_vh_stop,
  407.     terracre_vh_screenrefresh,
  408.  
  409.     /* sound hardware */
  410.     0,0,0,0,
  411.     {
  412.         {
  413.            SOUND_YM2203,
  414.            &ym2203_interface
  415.         },
  416.         {
  417.             SOUND_DAC,
  418.             &dac_interface
  419.         }
  420.     }
  421. };
  422.  
  423.  
  424.  
  425. ROM_START( terracre )
  426.     ROM_REGION( 0x20000, REGION_CPU1 )    /* 128K for 68000 code */
  427.     ROM_LOAD_ODD ( "1a_4b.rom",    0x00000, 0x4000, 0x76f17479 )
  428.     ROM_LOAD_EVEN( "1a_4d.rom",    0x00000, 0x4000, 0x8119f06e )
  429.     ROM_LOAD_ODD ( "1a_6b.rom",    0x08000, 0x4000, 0xba4b5822 )
  430.     ROM_LOAD_EVEN( "1a_6d.rom",    0x08000, 0x4000, 0xca4852f6 )
  431.     ROM_LOAD_ODD ( "1a_7b.rom",    0x10000, 0x4000, 0xd0771bba )
  432.     ROM_LOAD_EVEN( "1a_7d.rom",    0x10000, 0x4000, 0x029d59d9 )
  433.     ROM_LOAD_ODD ( "1a_9b.rom",    0x18000, 0x4000, 0x69227b56 )
  434.     ROM_LOAD_EVEN( "1a_9d.rom",    0x18000, 0x4000, 0x5a672942 )
  435.  
  436.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound cpu */
  437.     ROM_LOAD( "2a_15b.rom",   0x0000, 0x4000, 0x604c3b11 )
  438.     ROM_LOAD( "2a_17b.rom",   0x4000, 0x4000, 0xaffc898d )
  439.     ROM_LOAD( "2a_18b.rom",   0x8000, 0x4000, 0x302dc0ab )
  440.  
  441.     ROM_REGION( 0x02000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  442.     ROM_LOAD( "2a_16b.rom",   0x00000, 0x2000, 0x591a3804 ) /* tiles */
  443.  
  444.     ROM_REGION( 0x10000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  445.     ROM_LOAD( "1a_15f.rom",   0x00000, 0x8000, 0x984a597f ) /* Background */
  446.     ROM_LOAD( "1a_17f.rom",   0x08000, 0x8000, 0x30e297ff )
  447.  
  448.     ROM_REGION( 0x10000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  449.     ROM_LOAD( "2a_6e.rom",    0x00000, 0x4000, 0xbcf7740b ) /* Sprites */
  450.     ROM_LOAD( "2a_7e.rom",    0x04000, 0x4000, 0xa70b565c )
  451.     ROM_LOAD( "2a_6g.rom",    0x08000, 0x4000, 0x4a9ec3e6 )
  452.     ROM_LOAD( "2a_7g.rom",    0x0c000, 0x4000, 0x450749fc )
  453.  
  454.     ROM_REGION( 0x0500, REGION_PROMS )
  455.     ROM_LOAD( "tc1a_10f.bin", 0x0000, 0x0100, 0xce07c544 )    /* red component */
  456.     ROM_LOAD( "tc1a_11f.bin", 0x0100, 0x0100, 0x566d323a )    /* green component */
  457.     ROM_LOAD( "tc1a_12f.bin", 0x0200, 0x0100, 0x7ea63946 )    /* blue component */
  458.     ROM_LOAD( "tc2a_2g.bin",  0x0300, 0x0100, 0x08609bad )    /* sprite lookup table */
  459.     ROM_LOAD( "tc2a_4e.bin",  0x0400, 0x0100, 0x2c43991f )    /* sprite palette bank */
  460. ROM_END
  461.  
  462. /**********************************************************/
  463. /* Notes: All the roms are the same except the SOUND ROMs */
  464. /**********************************************************/
  465.  
  466. ROM_START( terracrb )
  467.     ROM_REGION( 0x20000, REGION_CPU1 )    /* 128K for 68000 code */
  468.     ROM_LOAD_ODD ( "1a_4b.rom",    0x00000, 0x4000, 0x76f17479 )
  469.     ROM_LOAD_EVEN( "1a_4d.rom",    0x00000, 0x4000, 0x8119f06e )
  470.     ROM_LOAD_ODD ( "1a_6b.rom",    0x08000, 0x4000, 0xba4b5822 )
  471.     ROM_LOAD_EVEN( "1a_6d.rom",    0x08000, 0x4000, 0xca4852f6 )
  472.     ROM_LOAD_ODD ( "1a_7b.rom",    0x10000, 0x4000, 0xd0771bba )
  473.     ROM_LOAD_EVEN( "1a_7d.rom",    0x10000, 0x4000, 0x029d59d9 )
  474.     ROM_LOAD_ODD ( "1a_9b.rom",    0x18000, 0x4000, 0x69227b56 )
  475.     ROM_LOAD_EVEN( "1a_9d.rom",    0x18000, 0x4000, 0x5a672942 )
  476.  
  477.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound cpu */
  478.     ROM_LOAD( "2a_15b.rom",   0x0000, 0x4000, 0x604c3b11 )
  479.     ROM_LOAD( "dg.12",        0x4000, 0x4000, 0x9e9b3808 )
  480.     ROM_LOAD( "2a_18b.rom",   0x8000, 0x4000, 0x302dc0ab )
  481.  
  482.     ROM_REGION( 0x02000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  483.     ROM_LOAD( "2a_16b.rom",   0x00000, 0x2000, 0x591a3804 ) /* tiles */
  484.  
  485.     ROM_REGION( 0x10000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  486.     ROM_LOAD( "1a_15f.rom",   0x00000, 0x8000, 0x984a597f ) /* Background */
  487.     ROM_LOAD( "1a_17f.rom",   0x08000, 0x8000, 0x30e297ff )
  488.  
  489.     ROM_REGION( 0x10000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  490.     ROM_LOAD( "2a_6e.rom",    0x00000, 0x4000, 0xbcf7740b ) /* Sprites */
  491.     ROM_LOAD( "2a_7e.rom",    0x04000, 0x4000, 0xa70b565c )
  492.     ROM_LOAD( "2a_6g.rom",    0x08000, 0x4000, 0x4a9ec3e6 )
  493.     ROM_LOAD( "2a_7g.rom",    0x0c000, 0x4000, 0x450749fc )
  494.  
  495.     ROM_REGION( 0x0500, REGION_PROMS )
  496.     ROM_LOAD( "tc1a_10f.bin", 0x0000, 0x0100, 0xce07c544 )    /* red component */
  497.     ROM_LOAD( "tc1a_11f.bin", 0x0100, 0x0100, 0x566d323a )    /* green component */
  498.     ROM_LOAD( "tc1a_12f.bin", 0x0200, 0x0100, 0x7ea63946 )    /* blue component */
  499.     ROM_LOAD( "tc2a_2g.bin",  0x0300, 0x0100, 0x08609bad )    /* sprite lookup table */
  500.     ROM_LOAD( "tc2a_4e.bin",  0x0400, 0x0100, 0x2c43991f )    /* sprite palette bank */
  501. ROM_END
  502.  
  503. /**********************************************************/
  504. /* Notes: All the roms are the same except the SOUND ROMs */
  505. /**********************************************************/
  506.  
  507. ROM_START( terracra )
  508.     ROM_REGION( 0x20000, REGION_CPU1 )    /* 128K for 68000 code */
  509.     ROM_LOAD_ODD ( "1a_4b.rom",    0x00000, 0x4000, 0x76f17479 )
  510.     ROM_LOAD_EVEN( "1a_4d.rom",    0x00000, 0x4000, 0x8119f06e )
  511.     ROM_LOAD_ODD ( "1a_6b.rom",    0x08000, 0x4000, 0xba4b5822 )
  512.     ROM_LOAD_EVEN( "1a_6d.rom",    0x08000, 0x4000, 0xca4852f6 )
  513.     ROM_LOAD_ODD ( "1a_7b.rom",    0x10000, 0x4000, 0xd0771bba )
  514.     ROM_LOAD_EVEN( "1a_7d.rom",    0x10000, 0x4000, 0x029d59d9 )
  515.     ROM_LOAD_ODD ( "1a_9b.rom",    0x18000, 0x4000, 0x69227b56 )
  516.     ROM_LOAD_EVEN( "1a_9d.rom",    0x18000, 0x4000, 0x5a672942 )
  517.  
  518.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k to sound cpu */
  519.     ROM_LOAD( "tc2a_15b.bin", 0x0000, 0x4000, 0x790ddfa9 )
  520.     ROM_LOAD( "tc2a_17b.bin", 0x4000, 0x4000, 0xd4531113 )
  521.  
  522.     ROM_REGION( 0x02000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  523.     ROM_LOAD( "2a_16b.rom",   0x00000, 0x2000, 0x591a3804 ) /* tiles */
  524.  
  525.     ROM_REGION( 0x10000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  526.     ROM_LOAD( "1a_15f.rom",   0x00000, 0x8000, 0x984a597f ) /* Background */
  527.     ROM_LOAD( "1a_17f.rom",   0x08000, 0x8000, 0x30e297ff )
  528.  
  529.     ROM_REGION( 0x10000, REGION_GFX3 | REGIONFLAG_DISPOSE )
  530.     ROM_LOAD( "2a_6e.rom",    0x00000, 0x4000, 0xbcf7740b ) /* Sprites */
  531.     ROM_LOAD( "2a_7e.rom",    0x04000, 0x4000, 0xa70b565c )
  532.     ROM_LOAD( "2a_6g.rom",    0x08000, 0x4000, 0x4a9ec3e6 )
  533.     ROM_LOAD( "2a_7g.rom",    0x0c000, 0x4000, 0x450749fc )
  534.  
  535.     ROM_REGION( 0x0500, REGION_PROMS )
  536.     ROM_LOAD( "tc1a_10f.bin", 0x0000, 0x0100, 0xce07c544 )    /* red component */
  537.     ROM_LOAD( "tc1a_11f.bin", 0x0100, 0x0100, 0x566d323a )    /* green component */
  538.     ROM_LOAD( "tc1a_12f.bin", 0x0200, 0x0100, 0x7ea63946 )    /* blue component */
  539.     ROM_LOAD( "tc2a_2g.bin",  0x0300, 0x0100, 0x08609bad )    /* sprite lookup table */
  540.     ROM_LOAD( "tc2a_4e.bin",  0x0400, 0x0100, 0x2c43991f )    /* sprite palette bank */
  541. ROM_END
  542.  
  543.  
  544.  
  545. GAME( 1985, terracre, 0,        ym3526, terracre, 0, ROT270, "Nichibutsu", "Terra Cresta (YM3526 set 1)" )
  546. GAME( 1985, terracrb, terracre, ym3526, terracre, 0, ROT270, "Nichibutsu", "Terra Cresta (YM3526 set 2)" )
  547. GAME( 1985, terracra, terracre, ym2203, terracre, 0, ROT270, "Nichibutsu", "Terra Cresta (YM2203)" )
  548.